package com.tjsinfo.tjsoa.mail.action;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import com.tjsinfo.tjsoa.mail.bo.ITjsDraftBo;

/**
 * 删除草稿箱
 * @author wangxiaowei
 *
 */
public class DeleteEmailDrafAction extends Action{
	private ITjsDraftBo tjsDraftBo;
	public ITjsDraftBo getTjsDraftBo() {
		return tjsDraftBo;
	}
	public void setTjsDraftBo(ITjsDraftBo tjsDraftBo) {
		this.tjsDraftBo = tjsDraftBo;
	}
	@Override
	public ActionForward execute(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception {
		// TODO Auto-generated method stub
		
		
		if (tjsDraftBo.deleteTjsDraf(request.getParameterValues("checkbox2"))) {//删除的草稿
			request.setAttribute("linkurl", "tjsinfo/tjsoa/mail/emailDraftList.do");
    		request.setAttribute("message", "email.message.deleteemail");
			return mapping.findForward("success");
		} else {
			return mapping.findForward("error");
		}
	}
}
